package com.hu.morser;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MorserActivity extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab);

        TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
        FrameLayout frame = (FrameLayout) findViewById(android.R.id.tabcontent);
        TabSpec firstTabSpec = tabHost.newTabSpec("tid0");
        TabSpec secondTabSpec = tabHost.newTabSpec("tid1");
        
        Intent first = new Intent(this,EncodeTab.class);
        Intent second = new Intent(this, DecodeTab.class);
        
        firstTabSpec.setIndicator("Encode", getResources().getDrawable(R.drawable.ic_launcher)).setContent(first);
        secondTabSpec.setIndicator("Decode", getResources().getDrawable(R.drawable.ic_launcher)).setContent(second);

        tabHost.setup();
        tabHost.addTab(firstTabSpec);
        tabHost.addTab(secondTabSpec);
    }
}